	set varabbrev off
	set more off
	cap log close
	set mem 500m
	clear

	/*------[Matrix Start]------*/
	set obs 8
	forval i= 1(1)20{							
	gen Spalte`i' = .
	mkmat Spalte`i'
	}
	mkmat Spalte1 Spalte2 - Spalte7, matrix(matrixd)   

	drop Spalte*
	/*------[Matrix End]------*/

use "filepath\Uganda_shortterm.dta", clear


	   

	   




		 local sample=0


	
	gen variable_0=z_inv2_v0`sample'
	
	gen variable_1=z_sav6_v0`sample'

	gen variable_2=z_profit4_v0`sample'
	
	gen variable_3=z_loan1_v0`sample'



	 
	gen rt_versus_c=.
	replace rt_versus_c=1 if control==1
	replace rt_versus_c=0 if rulethumb==1

	gen p_versus_c=.
	replace p_versus_c=1 if control==1
	replace p_versus_c=0 if personalized==1


	foreach num of numlist 0(1)3 {

	local num2=2*`num'+1
	sum variable_`num' if wave==8

	matrix matrixd[`num2',1]=`r(N)'
	matrix matrixd[`num2',2]=round(`r(mean)',.01)
	matrix matrixd[`num2'+1,2]=round(`r(sd)',.01)


	sum variable_`num' if wave==8 & control==1
	matrix matrixd[`num2',3]=round(`r(mean)',.01)
	matrix matrixd[`num2'+1,3]=round(`r(sd)',.01)

	sum variable_`num' if wave==8 & rulethumb==1
	matrix matrixd[`num2',4]=round(`r(mean)',.01)
	matrix matrixd[`num2'+1,4]=round(`r(sd)',.01)

	ttest variable_`num', by(rt_versus_c)
	local diff=round(`r(mu_1)'-`r(mu_2)',.01)
	matrix matrixd[`num2',5]=round(`diff',.01)
	matrix matrixd[`num2'+1,5]=round(`r(p)',.01)


	sum variable_`num' if wave==8 & personalized==1
	matrix matrixd[`num2',6]=round(`r(mean)',.01)
	matrix matrixd[`num2'+1,6]=round(`r(sd)',.01)


	ttest variable_`num', by(p_versus_c)
	local diff=round(`r(mu_1)'-`r(mu_2)',.01)
	matrix matrixd[`num2',7]=round(`diff',.01)
	matrix matrixd[`num2'+1,7]=round(`r(p)',.01)



	}

	matrix list matrixd

	matrix rownames matrixd =  Investment_index _ Savings_index _ Profits_index _ Credit_Index _
	  
	matrix list matrixd
	outtable using ${DESC_PATH}/desc_vT2PB, mat(matrixd)  replace f(%9.0g %9.2fc %9.2fc %9.2fc %9.2fc  %9.2fc %9.2fc )



